import { Form } from 'element-ui';
import request from '../util/request2'

const baseUrl = process.env.NODE_ENV === 'production' ? '' : '/cycleMap'

export function loadEBCardApi(pageNo, pageSize, cardNo, phone) {
  return request({
    url:baseUrl+ "/lcebcard/listLcEbAll",
    method: "get",
    params: {
      pageNo: pageNo,
      pageSize: pageSize,
      cardNo: cardNo,
      phone: phone,
    }
  })
}

export function rechargerApi(cardNo, amount) {
  return request({
    url:baseUrl+ "/lcebcard/depositLcEbCardRecord",
    method: "get",
    params: {
      cardNo: cardNo,
      amount: amount,
    }
  });
}

export function cancelEBCardApi(form){
  return request({
    url:baseUrl+"/lcebcard",
    method:"put",
    data: form,
  })
}

export function reportLossEBCardApi(form) {
  return request({
    url:baseUrl+ '/lcebcard',
    method: 'put',
    data: form,
  });
}

export function addApi(form) {
  return request({
    url:baseUrl+ "/lcebcard",
    method: "post",
    data: form
  });
}

export function delApi(row){
  return request({
    url:baseUrl+"/lcebcard/selective",
    method:"delete",
    data:{
      id : row.id
    }
  })
}

export function batchDelApi(multipleSelection){
  let ids = new Array();
  for (let i = 0; i < multipleSelection.length; i++) {
    ids[i] = multipleSelection[i].id
  }
  return request({
    url:baseUrl+"/lcebcard",
    method:"delete",
    data:ids,
  })
}